precision mediump float;

struct directional_light {
	vec3 position;			
	vec3 halfplane;			
	vec4 ambient_color;  // make global
	vec4 diffuse_color;
	vec4 specular_color;
};

struct material_properties {
	vec4 ambient_color;
	vec4 diffuse_color;
	vec4 specular_color;
	float specular_exponent;
};

uniform material_properties v_material;
uniform directional_light v_light;

varying vec3 v_normal;

void main(){

	vec3 norm_normal = normalize(v_normal);
	
	float HdotN = dot(norm_normal, v_light.halfplane);
	
	vec4 specular_term = pow(max(0.0, HdotN), v_material.specular_exponent) * (v_light.specular_color * v_material.specular_color);

	gl_FragColor = vec4(v_normal, 1.0);

}